package xkp.lesson2;

public class TestCpu {
    public static void main(String[] args) throws InterruptedException {
        //线程是任务调度的最小单位
        //如果程序中开辟的线程过多，会严重消耗CPU资源
        while(true){
            Thread.sleep(20);
            new Thread(){
                @Override
                public void run() {
                    while(true){}
                }
            }.start();
        }
    }
}
